<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>网元计算器</title>
		<!-- 引入 layui.css -->
		<!-- <link rel="stylesheet" href="https://dns.lmwa.cn/npm/layui/2.6.8/css/layui.css"> -->
		<!-- <script src="https://www.layuicdn.com/layui-v2.6.8/layui.js"></script> -->
		<link rel="stylesheet" href="css/layui.css">
		<link rel="stylesheet" type="text/css" href="css/modules/layer/default/layer.css"/>
		<script src="js/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/excel.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="all">
			<form id="form" class="layui-form" action="" lay-filter="filter">
				<blockquote class="layui-elem-quote">类型选择</blockquote>
				<div class="layui-form-item item">
				  <label>网络类型</label>
				  <div class="layui-input-block">
				    <select lay-search lay-filter="netType">
							<!-- <option value="2g">2G</option> -->
				      <option value="45g">4/5G</option>
				      <option value="ims">IMS</option>
				    </select>
				  </div>
				</div>
				<div class="layui-form-item item">
				  <label>网元类型</label>
				  <div class="layui-input-block">
						<div class="45gWangYuan">
							<select lay-search lay-filter="wangYuanName">
							  <option value="AMF">AMF</option>
								<option value="SMF">SMF</option>
								<option value="CHF">CHF</option>
							  <option value="UDM">UDM/UDR</option>
								<option value="PCF">数据PCF</option>
								<option value="voPCF">语音PCF</option>
								<option value="UPF">UPF</option>
							</select>
						</div>
						<div class="imsWangYuan">
							<select lay-search lay-filter="wangYuanName">
							  <option value="cscf">CSCF</option>
							  <option value="as">VoLTE AS</option>
								<option value="sbc_c">VoLTE SBC-C</option>
								<option value="sbc_u">VoLTE SBC-U</option>
								<option value="dns">ENUM/DNS</option>
								<option value="centrexAs">统一 Centrex AS</option>
								<option value="hss">固网 IMS HSS</option>
								<option value="ibcf">IBCF/TrGW</option>
								<option value="i_sbc">I-SBC</option>
							</select>
						</div>
				  </div>
				</div>
				<div class="layui-form-item item">
				  <label>业务类型</label>
				  <div class="layui-input-block">
				    <input type="radio" name="businessType" value="c" title="ToC" checked lay-filter="businessType">
				    <input type="radio" name="businessType" value="b" title="ToB" lay-filter="businessType">
				  </div>
				</div>
				<blockquote class="layui-elem-quote">现状</blockquote>
				<div class="area item">
					<table border="0" id="bili" cellspacing="0" cellpadding="">
						<!-- 001 -->
						<tr>
							<td colspan="2">
								<div class="upload">
									<label class="layui-btn" for="upload" style="width: 60%;"> 上传文件 </label>
									<input type="file" id="upload"/>
								</div>
							</td>
						</tr>
						<tr>
							<td>
									<span class="fileName">请上传文件</span>
							</td>
						</tr>
					</table>
				</div>
				<blockquote class="layui-elem-quote">中间参数</blockquote>
				<div class="middle">
					<div class="item">
						<label>利用率</label>
						<input type="number" id="liYongLv" value="80" class="layui-input"/>
						<label>%</label>
					</div>
					<div class="item">
						<label>驻留比</label>
						<input type="number" id="zhuLiuBi" value="85" class="layui-input"/>
						<label>%</label>
					</div>
					<div class="item">
						<label>激活比</label>
						<input type="number" id="jiHuoBI" value="200" class="layui-input"/>
						<label>%</label>
					</div>
					<div class="item">
						<label>分裂门限</label>
						<input type="number" id="fenLie" value="800" class="layui-input"/>
						<label id="menXianUtil">万户</label>
					</div>
					<div class="item serverType">
						<label>服务器架构</label>
						<select lay-search lay-filter="serverType">
						  <option value="x86">X86</option>
						  <option value="arm">ARM</option>
						</select>
					</div>
					<div class="U item">
						<label>4G忙时流量</label>
						<input type="number" id="liuLiang4g" value="100" class="layui-input"/>
						<label>Kb/s</label>
					</div>
					<div class="U item">
						<label>5G忙时流量</label>
						<input type="number" id="liuLiang5g" value="250" class="layui-input"/>
						<label>Kb/s</label>
					</div>
					<div class="U item">
						<label>VoLTE忙时流量</label>
						<input type="number" id="liuLiangIms" value="15" class="layui-input"/>
						<label>Kb/s</label>
					</div>
					<div class="C"></div>
				</div>
				<button type="button" class="layui-btn" id="go">确定</button>
			</form>
			<div class="res layui-tab layui-tab-brief" lay-filter="switchTable">
				<ul class="layui-tab-title">
					<li class="layui-this">网元</li>
					<li>物理资源</li>
				</ul>
				<div class="layui-tab-content">
					<div class="itemRes">
						<table id="itemRes" class="layui-table" lay-filter="itemRes"></table>
						<div id="pager"></div>
					</div>
					<div class="wuLiRes">
						<table id="wuLiRes" class="layui-table" lay-filter="wuLiRes"></table>
						<div id="pager"></div>
					</div>
				</div>
				<button type="button" class="layui-btn" id="exports">导出</button>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		const wangYuanNowHeaderStr={
			id:'编号',
			cities5gStr:'5G下辖地市',citiesImsStr:'VoLTE下辖地市',cities4gStr:'4G下辖地市',cities2gStr:'2G下辖地市',
			cities:'下辖地市',shop:'厂商',ruanJianStr:'软件容量（基础）',ruanJian5gStr:'软件容量（5G）',
			ruanJianImsStr:'软件容量（VoLTE）',
		}
		const citiesHeaderStr={cities:'地市',allUser:'总用户',user5g:'5G用户',user4g:'4G用户',user2g:'2G用户',userIms:'IMS用户'}
		const sheetName={city:'地市',wangYuan:'网元情况',wuLi:'物理模型'}
		const wuLi={storage:'存储需求',memory:'内存需求',core:'计算资源需求'}
		const translate={
			HW:'华为',ZX:'中兴',ER:'爱立信','华为':'HW','中兴':'ZX','爱立信':'ER',
			cities2gStr:'user2gStr',user2gStr:'cities2gStr',
			cities4gStr:'user4gStr',user4gStr:'cities4gStr',
			cities5gStr:'user5gStr',user5gStr:'cities5gStr',
			citiesImsStr:'userImsStr',userImsStr:'citiesImsStr',
			AMF:'AMF/MME','AMF/MME':'AMF',SMF:'SMF/SAEGW-C','SMF/SAEGW-C':'SMF',
			UDM:'UMD/UDR','UDM/UDR':'UDM',PCF:'PCF/UDR','PCF/UDR':'PCF',voPCF:'语音PCF','语音PCF':'voPCF'
		}
		const itemLayConfig=[
			[
				{align: 'center', field: 'shop', title: '厂商', width:110, rowspan:3},
				{align: 'center', field: 'name', title: '网元名称', width:130, rowspan:3},
				{align: 'center', colspan: 4, title: '当前容量'},
				{align: 'center', colspan: 4, title: '建设容量'},
				{align: 'center', colspan: 4, title: '到达容量'},
				{align: 'center', field: 'unit', title: '单位', width:110, rowspan:3},
				{align: 'center', field: 'disaster', title: '容灾方式', width:110, rowspan:3},
				{align: 'center', field: 'cities5gStr', title: [wangYuanNowHeaderStr.cities5gStr], width:110, rowspan:3},
				{align: 'center', field: 'cities4gStr', title: [wangYuanNowHeaderStr.cities4gStr], width:110, rowspan:3},
				{align: 'center', field: 'cities2gStr', title: [wangYuanNowHeaderStr.cities2gStr], width:110, rowspan:3},
			],
			[
				{align: 'center', colspan: 2, title: '软件容量'},
				{align: 'center', colspan: 2, title: '硬件容量'},
				{align: 'center', colspan: 2, title: '软件容量'},
				{align: 'center', colspan: 2, title: '硬件容量'},
				{align: 'center', colspan: 2, title: '软件容量'},
				{align: 'center', colspan: 2, title: '硬件容量'},
			],
			[
				{field: 'nowRuanJian', title: '基础容量', width:110},
				{field: 'nowRuanJian5g', title: '5G容量', width:110},
				{field: 'nowYingJian', title: '基础容量', width:110},
				{field: 'nowYingJian5g', title: '5G容量', width:110},
				{field: 'addRuanJian', title: '基础容量', width:110},
				{field: 'addRuanJian5g', title: '5G容量', width:110},
				{field: 'addYingJian', title: '基础容量', width:110},
				{field: 'addYingJian5g', title: '5G容量', width:110},
				{field: 'overRuanJian', title: '基础容量', width:110},
				{field: 'overRuanJian5g', title: '5G容量', width:110},
				{field: 'overYingJian', title: '基础容量', width:110},
				{field: 'overYingJian5g', title: '5G容量', width:110},
			]
		]
		const itemLayConfigVoPcf=[
			[
				{align: 'center', field: 'shop', title: '厂商', width:110, rowspan:3},
				{align: 'center', field: 'name', title: '网元名称', width:130, rowspan:3},
				{align: 'center', colspan: 2, width:220,title: '当前容量'},
				{align: 'center', colspan: 2, width:220,title: '建设容量'},
				{align: 'center', colspan: 2, width:220,title: '到达容量'},
				{align: 'center', field: 'unit', title: '单位', width:110, rowspan:3},
				{align: 'center', field: 'disaster', title: '容灾方式', width:110, rowspan:3},
				{align: 'center', field: 'cities5gStr', title: [wangYuanNowHeaderStr.cities5gStr], width:110, rowspan:3},
				{align: 'center', field: 'cities4gStr', title: [wangYuanNowHeaderStr.cities4gStr], width:110, rowspan:3},
				{align: 'center', field: 'cities2gStr', title: [wangYuanNowHeaderStr.cities2gStr], width:110, rowspan:3},
			],
			[
				{align: 'center', field: 'nowRuanJian', width:110, title: '软件容量'},
				{align: 'center', field: 'nowYingJian', width:110, title: '硬件容量'},
				{align: 'center', field: 'addRuanJian', width:110, title: '软件容量'},
				{align: 'center', field: 'addYingJian', width:110, title: '硬件容量'},
				{align: 'center', field: 'overRuanJian', width:110, title: '软件容量'},
				{align: 'center', field: 'overYingJian', width:110, title: '硬件容量'},
			]
		]
		const itemLayConfigUdm=[
			[
				{align: 'center', field: 'shop', title: '厂商', width:110, rowspan:3},
				{align: 'center', field: 'name', title: '网元名称', width:130, rowspan:3},
				{align: 'center', colspan: 6, title: '当前容量'},
				{align: 'center', colspan: 6, title: '建设容量'},
				{align: 'center', colspan: 6, title: '到达容量'},
				{align: 'center', field: 'unit', title: '单位', width:110, rowspan:3},
				{align: 'center', field: 'disaster', title: '容灾方式', width:110, rowspan:3},
				{align: 'center', field: 'cities5gStr', title: [wangYuanNowHeaderStr.cities5gStr], width:110, rowspan:3},
				{align: 'center', field: 'cities4gStr', title: [wangYuanNowHeaderStr.cities4gStr], width:110, rowspan:3},
				{align: 'center', field: 'cities2gStr', title: [wangYuanNowHeaderStr.cities2gStr], width:110, rowspan:3},
				{align: 'center', field: 'citiesImsStr', title: [wangYuanNowHeaderStr.citiesImsStr], width:110, rowspan:3},
			],
			[
				{align: 'center', colspan: 3, title: '软件容量'},
				{align: 'center', colspan: 3, title: '硬件容量'},
				{align: 'center', colspan: 3, title: '软件容量'},
				{align: 'center', colspan: 3, title: '硬件容量'},
				{align: 'center', colspan: 3, title: '软件容量'},
				{align: 'center', colspan: 3, title: '硬件容量'},
			],
			[
				{field: 'nowRuanJian', title: '基础容量', width:110},
				{field: 'nowRuanJianIms', title: 'VoLTE容量', width:110},
				{field: 'nowRuanJian5g', title: '5G容量', width:110},
				{field: 'nowYingJian', title: '基础容量', width:110},
				{field: 'nowYingJianIms', title: 'VoLTE容量', width:110},
				{field: 'nowYingJian5g', title: '5G容量', width:110},
				{field: 'addRuanJian', title: '基础容量', width:110},
				{field: 'addRuanJianIms', title: 'VoLTE容量', width:110},
				{field: 'addRuanJian5g', title: '5G容量', width:110},
				{field: 'addYingJian', title: '基础容量', width:110},
				{field: 'addYingJianIms', title: 'VoLTE容量', width:110},
				{field: 'addYingJian5g', title: '5G容量', width:110},
				{field: 'overRuanJian', title: '基础容量', width:110},
				{field: 'overRuanJianIms', title: 'VoLTE容量', width:110},
				{field: 'overRuanJian5g', title: '5G容量', width:110},
				{field: 'overYingJian', title: '基础容量', width:110},
				{field: 'overYingJianIms', title: 'VoLTE容量', width:110},
				{field: 'overYingJian5g', title: '5G容量', width:110},
			]
		]
		const wuLiLayConfig=[
			[
				{align: 'center', field: 'shop', title: '厂商', width:110},
				{align: 'center', field: 'name', title: '网元名称', width:130},
				{align: 'center', field: 'core', title: '计算资源需求', width:130},
				{align: 'center', field: 'storage', title: '存储资源需求', width:130},
				{align: 'center', field: 'memory', title: '内存资源需求', width:130},
			]
		]
		// 预留比例
		let menXian={
			AMF:{value:800,unit:'万户',save:'pool',maxNum:12,liYongLv:80},
			SMF:{value:800,unit:'万pdu',save:'pool',maxNum:12,liYongLv:80},
			UPF:{value:300,unit:'gbps',save:'1+1',liYongLv:80},
			CHF:{value:1600,unit:'万pdu',save:'1+1',liYongLv:80},
			UDM:{value:1000,unit:'万活跃用户',save:'1+1',liYongLv:90},
			PCF:{value:2000,unit:'万pdu',save:'pool',maxNum:12,liYongLv:80},
			voPCF:{value:3000,unit:'万pdu',save:'pool',maxNum:12,liYongLv:80},
			cscf:{value:900,unit:'万户',save:'pool',liYongLv:80},
			as:{value:800,unit:'万户',save:'pool',liYongLv:80},
			sbc_c:{value:800,unit:'万户',save:'pool',liYongLv:80},
			sbc_u:{value:400,unit:'万户',save:'pool',liYongLv:80},
			dns:{value:8500,unit:'万户',save:'pool',liYongLv:80},
			centrexAS:{value:500,unit:'万户',save:'pool',liYongLv:80},
			hss:{value:1000,unit:'万户',save:'pool',liYongLv:80},
			ibcf:{value:8,unit:'万Erl',save:'pool',liYongLv:80},
			i_sbc:{value:12,unit:'万Erl',save:'pool',liYongLv:80}
		}
		let businessType='c',mian='c',netType='45g',province='湖南'
		let liYongLv_dom=document.getElementById('liYongLv')
		let zhuLiuBi_dom=document.getElementById('zhuLiuBi')
		let jiHuoBI_dom=document.getElementById('jiHuoBI')
		let yongHuShu4g_dom=document.getElementById('yongHuShu4g')
		let yongHuShu5g_dom=document.getElementById('yongHuShu5g')
		let fenLie_dom=document.getElementById('fenLie')
		let liuLiang_dom=document.getElementById('liuLiang')
		let go=document.getElementById('go')
		let exports_dom=document.getElementById('exports')
		let upload_dom=document.getElementById('upload')
		let wangYuanName='AMF'
		let dataWangYuanTypes=['UDM','PCF','UPF']
		let controllWangYuanTypes=['AMF','SMF','CHF','voPCF']
		let uploadFile
		let nowRuanJian=0,nowRuanJian5g=0,nowRuanJianIms=0,nowYingJian=0,nowYingJian5g=0,nowYingJianIms=0
		let addRuanJian=0,addRuanJian5g=0,addRuanJianIms=0,addYingJian=0,addYingJian5g=0,addYingJianIms=0
		let overRuanJian=0,overRuanJian5g=0,overRuanJian4g=0,overRuanJian2g=0,overRuanJianIms=0
		let overYingJian=0,overYingJian5g=0,overYingJian4g=0,overYingJian2g=0,overYingJianIms=0
		let serverType='X86'
		let layTable='itemRes'
		let showData={itemRes:[],wuLiRes:[]}
		var table = layui.table;
		var form = layui.form;
		var laypage = layui.laypage;
		var layer = layui.layer;
		var element = layui.element;
		var $=layui.jquery
		layui.use(['element', 'laypage', 'table', 'layer'], function(){
			layer.config({
			  skin: 'layui-layer-lan'
			})
			element.on('tab(switchTable)', function(data){
				if(data.index==0){
					layTable='itemRes'
					document.getElementsByClassName('itemRes')[0].style.display='block'
					document.getElementsByClassName('wuLiRes')[0].style.display='none'
				}else{
					layTable='wuLiRes'
					document.getElementsByClassName('wuLiRes')[0].style.display='block'
					document.getElementsByClassName('itemRes')[0].style.display='none'
				}
			});
			table.init('wuLiRes', {
			  height: 315 //设置高度
			  ,limit: 10
			}); 
			table.render({
				elem: '#wuLiRes',
				cols:wuLiLayConfig,
				data:[],
				text: {
					none: '暂无相关数据' //默认：无数据。???
				}
			})
			table.init('itemRes', {
			  limit: 20
			}); 
			table.render({
				elem: '#itemRes',
				cols:itemLayConfig,
				data:[],
				totalRow:true,
				text: {
					none: '暂无相关数据' //默认：无数据。???
				}
			})
		})
		layui.use('form', function(){
			form.on('select(netType)', function(data){
			  netType=data.value
				if(netType=='45g'){
					document.getElementsByClassName('imsWangYuan')[0].style.display='none'
					document.getElementsByClassName('45gWangYuan')[0].style.display='block'
				}
				else{
					document.getElementsByClassName('45gWangYuan')[0].style.display='none'
					document.getElementsByClassName('imsWangYuan')[0].style.display='block'
				}
			});
			function toogleCU(wangYuanName){
				if(wangYuanName=='sbc_u'||wangYuanName=='upf'){
					mian='u'
					for(let i of document.getElementsByClassName('C')){
						i.style.display='none'
					}
					for(let i of document.getElementsByClassName('U')){
						i.style.display='flex'
					}
				}else{
					mian='c'
					for(let i of document.getElementsByClassName('U')){
						i.style.display='none'
					}
					for(let i of document.getElementsByClassName('C')){
						i.style.display='flex'
					}
				}
			}
			fenLie_dom.onchange=(e)=>{
				menXian[wangYuanName].value=fenLie_dom.value
			}
			form.on('select(serverType)',function(data){
				serverType=data.value
			})
			form.on('select(wangYuanName)', function(data){
				let cols
			  wangYuanName=data.value
				toogleCU(wangYuanName)
				fenLie_dom.value=menXian[wangYuanName].value
				liYongLv_dom.value=menXian[wangYuanName].liYongLv
				document.getElementById('menXianUtil').innerText=menXian[wangYuanName].unit
				if(isUDM()){
					cols=itemLayConfigUdm
				}
				else if(isVoPcf()){
					cols=itemLayConfigVoPcf
				}
				else{
					cols=itemLayConfig
				}
				table.render({
					elem: '#itemRes',
					cols,
					data:[],
					text: {
						none: '暂无相关数据'
					}
				})
			});
			form.on('radio(businessType)', function(data){
			  businessType=data.value
			});
			//005
		})
		function isUDM(){
			return wangYuanName.indexOf('UDM')>-1?true:false
		}
		function isVoPcf(){
			return wangYuanName.indexOf('voPCF')>-1?true:false
		}
		function createRes(obj){
			let res
			addRuanJian=overRuanJian-nowRuanJian
			addYingJian=overYingJian-nowYingJian
			addRuanJian5g=overRuanJian5g-nowRuanJian5g
			addYingJian5g=overYingJian5g-nowYingJian5g
			addRuanJianIms=overRuanJianIms-nowRuanJianIms
			addYingJianIms=overYingJianIms-nowYingJianIms
			shop=obj.shop
			let cities5gStr=obj.cities5gStr
			let cities4gStr=obj.cities4gStr
			let cities2gStr=obj.cities2gStr
			let citiesImsStr=obj.citiesImsStr
			let name=obj.name
			if(isUDM()){
				res={
					shop,name,nowRuanJian,nowRuanJianIms,nowRuanJian5g,nowYingJian,nowYingJianIms,nowYingJian5g,
					addRuanJian,addRuanJianIms,addRuanJian5g,addYingJian,addYingJianIms,addYingJian5g,
					overRuanJian,overRuanJianIms,overRuanJian5g,overRuanJian4g,overRuanJian2g,
					overYingJian,overYingJianIms,overYingJian5g,overYingJian4g,overYingJian2g,
					unit:menXian[wangYuanName].unit,disaster:menXian[wangYuanName].save,
					cities5gStr,cities4gStr,
					cities2gStr,citiesImsStr
				}
			}
			else if(isVoPcf()){
				res={
					shop,name,nowRuanJian,nowYingJian,
					addRuanJian,addYingJian,
					overRuanJian,overYingJian,
					unit:menXian[wangYuanName].unit,disaster:menXian[wangYuanName].save,
					cities5gStr,cities4gStr,cities2gStr
				}
			}
			else{
				res={
					shop,name,nowRuanJian,nowRuanJian5g,nowYingJian,nowYingJian5g,
					addRuanJian,addRuanJian5g,addYingJian,addYingJian5g,
					overRuanJian,overRuanJian5g,overRuanJian4g,overRuanJian2g,
					overYingJian,overYingJian5g,overYingJian4g,overYingJian2g,
					unit:menXian[wangYuanName].unit,disaster:menXian[wangYuanName].save,
					cities5gStr,cities4gStr,cities2gStr
				}
			}
			return res
		}
		// num为备份前组件数量
		function multipleSection(num,save){
			let res=0
			// 处理备份字符串为字母（以下简称N）的情况
			if(save.match&&save.match(/([a-z]|[A-Z])/g)){
				// 把备份字符串中的N改成1N
				save=save.replace(/((\D)([a-z]|[A-Z])+)/g,(str,fuHao,beiShu)=>{
					return fuHao+'1'+beishu
				})
				// 如果备份字符串第一个字符为N，改成1N
				save=save.replace(/^([a-z]|[A-Z]+)/g,(res)=>'1'+res)
				// 如果备份字符串没有乘号，则将N替换为*num，即1N*num或者2N*num
				let numWithChengHao='*num'
				// 如果备份字符串有乘号，如2*N，则将N替换为num
				if(save.match(/\*/g)){
					numWithChengHao='num'
				}
				// 执行替换
				save=save.replace(/([a-z]|[A-Z]+)/g,(res)=>numWithChengHao)
			}
			// num为常数时视作增加
			else{
				save+='+num'
			}
			try{
				console.log(save);
				res=eval(save)
			}catch(e){
				//
			}finally{
				return res
			}
		}
		function getUdmSection(wangYuan,info){
			let num=0
			let userTypes=['overYingJian','overYingJian5g','overYingJian4g','overYingJianIms']
			for(let type of userTypes){
				if(info[type]){
					if(type=='overYingJian'||type=='overYingJian5g'){
						num+=wangYuan[type]/info[type]
					}
					if(type=='overYingJian4g'){
						num+=(wangYuan.overYingJian-wangYuan.overYingJianIms)/info[type]
					}
					if(type=='overYingJianIms'){
						num+=(wangYuan.overYingJianIms-wangYuan.overYingJian5g)/info[type]
					}
				}
			}
			return Math.ceil(num)
		}
		function getNoUdmSection(wangYuan,info){
			let userTypes=['overYingJian','overYingJian5g','overYingJian4g','overYingJian2g'],num=0
			for(let type of userTypes){
				if(info[type]){
					num+=wangYuan[type]/info[type]
				console.log(wangYuan,info,type,num);
				}
			}
			return Math.ceil(num)
		}
		function getSection(wangYuan,info){
			let core=0,storage=0,memory=0,functionName=info.functionName,num=0
			if(isUDM()){
				num=getUdmSection(wangYuan,info)
			}else{
				num=getNoUdmSection(wangYuan,info)
			}
			if(info.save){
				if(info.menXian&&wangYuan.overYingJian>info.menXian){
					num=Math.ceil(multipleSection(num,info.saveBig))
				}else{
					num=Math.ceil(multipleSection(num,info.save))
				}
			}
			if(info.isDual=='是'){
				num=num%2==0?num:num+1
			}
			core+=info.core*num
			storage+=info.storage*num
			memory+=info.memory*num
			return {functionName,num,core,storage,memory}
		}
		function getWuLi(wangYuan){
			let model=uploadFile[sheetName.wuLi][serverType][wangYuanName]
			if(!model){
				model=uploadFile[sheetName.wuLi][serverType][translate[wangYuanName]]
			}
			let res,core=0,storage=0,memory=0
			for(let i of model){
				res=getSection(wangYuan,i)
				console.log(res);
				core+=res.core
				storage+=res.storage
				memory+=res.memory
			}
			return {shop:wangYuan.shop,name:wangYuan.name,core,storage,memory}
		}
		function getUDR(wangYuan){
			
		}
		function calculateWuLi(){
			let wangYuans=showData.itemRes,resItem,res=[]
			for(let wangYuan of wangYuans){
				resItem=getWuLi(wangYuan)
				res.push(resItem)
			}
			return res
		}
		function getUserToPdu(){
			if(menXian[wangYuanName].unit=='万pdu')
				return 2
			else return 1
		}
		function getRuanToYing(){
			return !dataWangYuanTypes.includes(wangYuanName)?2:1
		}
		// 002
		function check(all){
			if(wangYuanName=='upf'||wangYuanName=='sbc_u'){
				
			}else{
				for(let i=0;i<all.length-1;i++){
					if(all[i].taoShu%2!=0){
						layer.msg('套数应为偶数', {icon: 3,time: 2000});
						return
					}
					if(menXian[wangYuanName].save=='pool'){
						if(all[i].taoShu>menXian[wangYuanName].maxNum){
							layer.msg('套数过大', {icon: 3,time: 2000});
						}
					}
				}
			}
		}
		function getWangYuanUsers(wangYuans){
			let hnCities=uploadFile[sheetName.city]
			let wangYuanCityType,userBili=1
			let userTypes=['user5gStr','user4gStr','user2gStr']
			if(isUDM())
				userTypes.push('userImsStr')
			for(let wangYuan of wangYuans){
				wangYuan.allUserStrarr=[]
				wangYuan.allUserStr=0
				for(let type of userTypes){
					wangYuanCityType=translate[type] 
					wangYuan[type]=0
					wangYuan[type+'arr']=[]
					if(wangYuan[wangYuanCityType]=='全省'){
						for(let city of hnCities){
							wangYuan[type+'arr'].push({name:city.cityNameStr,value:city[type]})
							wangYuan[type]+=city[type]
							if(type=='user5gStr'){
								wangYuan.allUserStr+=city.allUserStr
							}
						}
					}
					else{
						let index,CityWithBiliName
						for(let city of hnCities){
							index=wangYuan[wangYuanCityType].indexOf(city.cityNameStr)
							if(index>-1){
								if(wangYuan[wangYuanCityType][index-1]=='%'){
									userBili=wangYuan[wangYuanCityType].slice(index-3,index-1).match(/\d+/)[0]*1
								}else{
									userBili=100
								}
								CityWithBiliName=userBili<100?userBili+'%'+city['cityNameStr']:city['cityNameStr']
								wangYuan[type+'arr'].push({name:CityWithBiliName,value:city[type]*userBili/100})
								wangYuan[type]+=city[type]*userBili/100
								if(type=='user5gStr'){
									wangYuan['allUserStrarr'].push({name:CityWithBiliName,value:city['allUserStr']*userBili/100})
									wangYuan.allUserStr+=city.allUserStr*userBili/100
								}
							}
						}
					}
				}
			}
		}
		function handleWuLiTable(tabel){
			let res={},nowServerType,nowWangYuan
			for(let item of tabel){
				if(item.serverType){
					nowServerType=item.serverType
					res[nowServerType]={}
				}
				if(item.wangYuan.length){
					nowWangYuan=item.wangYuan
					res[nowServerType][nowWangYuan]=[]
				}
				res[nowServerType][nowWangYuan].push(item)
				delete item.serverType
				delete item.wangYuan
			}
			return res
		}
		// 上传处理
		upload_dom.onchange=(e)=>{
			let files = e.target.files;
			console.log(e);
			LAY_EXCEL.importExcel(files, {},
				function(data){
					let wangYuanTable={0:{[sheetName.wangYuan]:data[0][sheetName.wangYuan]}}
					let cityTable={0:{[sheetName.city]:data[0][sheetName.city]}}
					let wuLiTable={0:{[sheetName.wuLi]:data[0][sheetName.wuLi]}}
					wangYuanTable = LAY_EXCEL.filterImportData(wangYuanTable, {
						id: 'A'
						,cities5gStr: 'B'
						,cities4gStr: 'C'
						,cities2gStr: 'D'
						,citiesImsStr: 'E'
						,ruanJianStr: 'F'
						,ruanJian5gStr: 'G'
						,ruanJianImsStr: 'H'
						,shop: 'I'
					})
					cityTable = LAY_EXCEL.filterImportData(cityTable, {
						cityNameStr: 'A'
						,allUserStr: 'B'
						,user5gStr: 'C'
						,user4gStr: 'D'
						,user2gStr: 'E'
						,userImsStr: 'F'
					})
					wuLiTable = LAY_EXCEL.filterImportData(wuLiTable, {
						serverType: 'A',
						wangYuan: 'B',
						functionName: 'C',
						core: 'E',
						storage: 'F',
						memory: 'G',
						save:'H',
						saveBig:'I',
						isDual:'J',
						menXian:'K',
						overYingJian: 'L',
						overYingJian5g: 'M',
						overYingJian4g: 'N',
						overYingJian2g: 'O',
						overYingJianIms: 'P',
					})
					uploadFile={
						[sheetName.city]:cityTable[0][sheetName.city],
						[sheetName.wangYuan]:wangYuanTable[0][sheetName.wangYuan],
						[sheetName.wuLi]:wuLiTable[0][sheetName.wuLi],
					}
					uploadFile[sheetName.city].shift()
					uploadFile[sheetName.wangYuan].shift()
					uploadFile[sheetName.wuLi].shift()
					uploadFile[sheetName.wuLi]=handleWuLiTable(uploadFile[sheetName.wuLi])
					layer.msg('上传成功', {icon: 1,time: 2000});
					document.getElementsByClassName('fileName')[0].innerText=e.target.files[0].name
			})
		}
		function cleanKey(obj,excelHeader){
			for(let i in obj){
				if(!(i in excelHeader)){
					delete obj[i]
				}
			}
			return obj
		}
		function clone(tar,obj={}){
			for(let i in tar){
				if(tar[i] instanceof Array){
					obj[i]=clone(tar[i],[])
				}
				else if(tar[i] instanceof Object){
					obj[i]=clone(tar[i],{})
				}
				else obj[i]=tar[i]
			}
			return obj
		}
		function exports(data){
			let wuLiHeader=[
        {name:'网元名称',core:wuLi.core,storage:wuLi.storage,memory:wuLi.memory}
			]
			let itemTable=[
			  {shop:'厂商',name:'网元名称',nowRuanJian:'当前容量',nowRuanJian5g:'',nowYingJian:'',nowYingJian5g:'',
				addRuanJian:'建设容量',addRuanJian5g:'',addYingJian:'',addYingJian5g:'',
				overRuanJian:'到达容量',overRuanJian5g:'',overYingJian:'',overYingJian5g:'',
				unit:'单位',disaster:'容灾方式',cities5gStr:'5G下辖地市',cities4gStr:'4G下辖地市',
				cities2gStr:'2G下辖地市'},
			  {shop:'',name:'',nowRuanJian:'软件容量',nowRuanJian5g:'',nowYingJian:'硬件容量',nowYingJian5g:'',
				addRuanJian:'软件容量',addRuanJian5g:'',addYingJian:'硬件容量',addYingJian5g:'',
				overRuanJian:'软件容量',overRuanJian5g:'',overYingJian:'硬件容量',overYingJian5g:'',
				unit:'',disaster:'',cities5gStr:'',cities4gStr:'',
				cities2gStr:''},
				{shop:'',name:'',nowRuanJian:'基础容量',nowRuanJian5g:'5G容量',nowYingJian:'基础容量',nowYingJian5g:'5G容量',
				addRuanJian:'基础容量',addRuanJian5g:'5G容量',addYingJian:'基础容量',addYingJian5g:'5G容量',
				overRuanJian:'基础容量',overRuanJian5g:'5G容量',overYingJian:'基础容量',overYingJian5g:'5G容量',
				unit:'',disaster:'',cities5gStr:'',cities4gStr:'',
				cities2gStr:''},
			]
			let itemTableVoPcf=[
			  {shop:'厂商',name:'网元名称',nowRuanJian:'当前容量',nowYingJian:'',
				addRuanJian:'建设容量',addYingJian:'',
				overRuanJian:'到达容量',overYingJian:'',
				unit:'单位',disaster:'容灾方式',cities5gStr:'5G下辖地市',cities4gStr:'4G下辖地市',cities2gStr:'2G下辖地市'},
			  {shop:'',name:'',nowRuanJian:'软件容量',nowYingJian:'硬件容量',
				addRuanJian:'软件容量',addYingJian:'硬件容量',
				overRuanJian:'软件容量',overYingJian:'硬件容量',
				unit:'',disaster:'',citiesImsStr:''},
				{shop:'',name:'',nowRuanJian:'基础容量',nowYingJian:'基础容量',
				addRuanJian:'基础容量',addYingJian:'基础容量',
				overRuanJian:'基础容量',overYingJian:'基础容量',
				unit:'',disaster:'',citiesImsStr:'',},
			]
			let itemTableUdm=[
			  {shop:'厂商',name:'网元名称',
				nowRuanJian:'当前容量',nowRuanJianIms:'',nowRuanJian5g:'',nowYingJian:'',nowYingJianIms:'',nowYingJian5g:'',
				addRuanJian:'建设容量',addRuanJianIms:'',addRuanJian5g:'',addYingJian:'',addYingJianIms:'',addYingJian5g:'',
				overRuanJian:'到达容量',overRuanJianIms:'',overRuanJian5g:'',overYingJian:'',overYingJianIms:'',overYingJian5g:'',
				unit:'单位',disaster:'容灾方式',cities5gStr:'5G下辖地市',cities4gStr:'4G下辖地市',
				cities2gStr:'2G下辖地市',citiesImsStr:'VoTEL下辖地市'},
			  {shop:'',name:'',
				nowRuanJian:'软件容量',nowRuanJianIms:'',nowRuanJian5g:'',nowYingJian:'硬件容量',nowYingJianIms:'',nowYingJian5g:'',
				addRuanJian:'软件容量',addRuanJianIms:'',addRuanJian5g:'',addYingJian:'硬件容量',addYingJianIms:'',addYingJian5g:'',
				overRuanJian:'软件容量',overRuanJianIms:'',overRuanJian5g:'',overYingJian:'硬件容量',overYingJianIms:'',overYingJian5g:'',
				unit:'',disaster:'',cities5gStr:'',cities4gStr:'',
				cities2gStr:'',citiesImsStr:''},
				{shop:'',name:'',
				nowRuanJian:'基础容量',nowRuanJianIms:'VoLTE容量',nowRuanJian5g:'5G容量',nowYingJian:'基础容量',nowYingJianIms:'VoLTE容量',nowYingJian5g:'5G容量',
				addRuanJian:'基础容量',addRuanJianIms:'VoLTE容量',addRuanJian5g:'5G容量',addYingJian:'基础容量',addYingJianIms:'VoLTE容量',addYingJian5g:'5G容量',
				overRuanJian:'基础容量',overRuanJianIms:'VoLTE容量',overRuanJian5g:'5G容量',overYingJian:'基础容量',overYingJianIms:'VoLTE容量',overYingJian5g:'5G容量',
				unit:'',disaster:'',cities5gStr:'',cities4gStr:'',
				cities2gStr:'',citiesImsStr:''},
			]
			let mergeConfig=[
				['A1', 'A3'],
				['B1', 'B3'],
				['C1', 'F1'],
				['C2', 'D2'],
				['E2', 'F2'],
				['G1', 'J1'],
				['K1', 'N1'],
				['K2', 'L2'],
				['G2', 'H2'],
				['I2', 'J2'],
				['M2', 'N2'],
				['O1', 'O3'],
				['P1', 'P3'],
				['Q1', 'Q3'],
				['R1', 'R3'],
				['S1', 'S3'],
			]
			let mergeConfigVoPcf=[
				['A1', 'A3'],
				['B1', 'B3'],
				['C1', 'D1'],
				['E1', 'F1'],
				['G1', 'H1'],
				['I1', 'I3'],
				['J1', 'J3'],
				['K1', 'K3'],
				['L1', 'L3'],
				['M1', 'M3'],
			]
			let mergeConfigUdm=[
				['A1', 'A3'],
				['B1', 'B3'],
				['C1', 'H1'],
				['C2', 'E2'],
				['F2', 'H2'],
				['I1', 'N1'],
				['I2', 'K2'],
				['L2', 'N2'],
				['I2', 'J2'],
				['O1', 'T1'],
				['O2', 'Q2'],
				['R2', 'T2'],
				['U1', 'U3'],
				['V1', 'V3'],
				['W1', 'W3'],
				['X1', 'X3'],
				['Y1', 'Y3'],
				['Z1', 'Z3'],
			]
			let mergeRes,excelHeader,itemData=data.itemRes,wuLiData=data.wuLiRes
			if(isUDM()){
				mergeRes=mergeConfigUdm
				excelHeader=itemTableUdm
			}
			else if(isVoPcf()){
				mergeRes=mergeConfigVoPcf
				excelHeader=itemTableVoPcf
			}
			else{
				mergeRes=mergeConfig
				excelHeader=itemTable
			}
			for(let i=0;i<itemData.length;i++){
				excelHeader.push(cleanKey(clone(itemData[i]),excelHeader[0]))
			}
			for(let i=0;i<wuLiData.length;i++){
				wuLiHeader.push(cleanKey(clone(wuLiData[i]),wuLiHeader[0]))
			}
			// 配置合并单元格
			var itemTableMergeConf = LAY_EXCEL.makeMergeConfig(mergeRes)
			// 2. 配置 列宽 C列宽 150，E列宽150，默认80
			var colConf = LAY_EXCEL.makeColConfig({
				'A':60,
				'B': 110,
			}, 90)
			// 3. 第1行行高40，第二行行高30，默认20
			var rowConf = LAY_EXCEL.makeRowConfig({
					1: 40,
					3: 30
			}, 20)
			// LAY_EXCEL.setExportCellStyle(allTable, 'A1:I50',{
			// 	s:{
			// 		alignment: {horizontal: 'center',vertical: 'center'}
			// 	}
			// })
			LAY_EXCEL.setExportCellStyle(excelHeader, 'A1:Z'+(excelHeader.length),{
				s:{
					alignment: {horizontal: 'center',vertical: 'center'}
				}
			})
			LAY_EXCEL.exportExcel({
					'容量情况': excelHeader,
					'物理需求': wuLiHeader,
			}, '总规模表.xlsx', 'xlsx', {
					extend: {
						// extend 中可以指定某个 sheet 的属性，如果不指定 sheet 则所有 sheet 套用同一套属性
						'物理需求': {
								'!cols': colConf,
						},
						'容量情况':{
							'!merges': itemTableMergeConf,
							'!cols': colConf,
						}
					}
			});
		}
		// 003
		
		function getNow(wangYuan){
			let bili=1
			if(wangYuan==0){
				nowRuanJian5g=nowYingJian5g=0,nowRuanJian=nowYingJian=0,nowRuanJianIms=nowYingJianIms=0
			}else{
				nowRuanJian=wangYuan.ruanJianStr
				nowRuanJian5g=wangYuan.ruanJian5gStr
				nowRuanJianIms=wangYuan.ruanJianImsStr
				if(controllWangYuanTypes.includes(wangYuanName))
					bili=2
				nowYingJian=nowRuanJian*bili
				nowYingJian5g=nowRuanJian5g*bili
				nowYingJianIms=nowRuanJianIms*bili
			}
		}
		function getDataOver(wangYuan){
			overRuanJian=overYingJian=Math.ceil(wangYuan.allUserStr/(liYongLv_dom.value/100))
			overRuanJianIms=overYingJianIms=Math.ceil(wangYuan.userImsStr/(liYongLv_dom.value/100))
			overRuanJian2g=overYingJian2g=Math.ceil(wangYuan.user2gStr/(liYongLv_dom.value/100))
			overRuanJian4g=overYingJian4g=Math.ceil(wangYuan.user4gStr/(liYongLv_dom.value/100))
			overRuanJian5g=overYingJian5g=Math.ceil(wangYuan.user5gStr/(liYongLv_dom.value/100))
		}
		function fenPeiAddCity(wangYuan,userType,city){
			if(wangYuan[translate[userType]].length)
				wangYuan[translate[userType]]+='/'+city.name
			else wangYuan[translate[userType]]+=city.name
			wangYuan[userType]+=city.value
			if(userType!='userImsStr'){
				wangYuan.allUserStr+=city.value
			}
			wangYuan[userType+'arr'].push(city)
		}
		function createFenPeiRes(wangYuan,old,id){
			wangYuan.shop=old.shop
			if(id==old.id){
				getNow(old)
				wangYuan.name=province+wangYuanName+translate[old.shop]+id
				wangYuan.id=old.id
			}
			else{
				getNow(0)
				wangYuan.name=province+wangYuanName+translate[old.shop]+id
				wangYuan.id=fenId
			}
			getDataOver(wangYuan)
			return createRes(wangYuan)
		}
		let fenId=0
		function fenPei(old,num){
			let cities=uploadFile[sheetName.city]
			let userTypes=['user5gStr','user4gStr','user2gStr']
			if(isUDM()){
				userTypes.push('userImsStr')
			}
			let res=[]
			let new1=JSON.parse(JSON.stringify(old))
			for(let i in new1){
				if(typeof new1[i]=='number'){
					new1[i]=0
				}if(typeof new1[i]=='string'){
					new1[i]=''
				}if(Array.isArray(new1[i])){
					new1[i]=[]
				}
			}
			let new2=JSON.parse(JSON.stringify(new1))
			for(let userType of userTypes){
				for(let city of old[userType+'arr']){
					if(new1[userType]>new2[userType]){
						fenPeiAddCity(new2,userType,city)
					}else{
						fenPeiAddCity(new1,userType,city)
					}
				}
			}
			let res1=createFenPeiRes(new1,old,old.id)
			let res2=createFenPeiRes(new2,old,fenId)
			if(res1.overRuanJian>menXian[wangYuanName]['value']){
				layer.msg('error', {icon: 2,time: 2000});
				res.push(...fenPei(new1,fenId))
			}
			else res.push(res1) 
			if(res2.overRuanJian>menXian[wangYuanName]['value']){
				layer.msg('error', {icon: 2,time: 2000});
				res.push(...fenPei(new2,fenId))
			}
			else{
				res.push(res2)
				++fenId
			}
			return res
		}
		
		function calculateData(){
			let wangYuans=uploadFile[sheetName.wangYuan]
			let resItem,res=[],shop
			let num=wangYuans.length+1
			fenId=num
			for(let wangYuan of wangYuans){
				shop=wangYuan.shop
				getNow(wangYuan)
				getDataOver(wangYuan)
				if(overRuanJian<menXian[wangYuanName].value){
					wangYuan.name=province+wangYuanName+translate[shop]+wangYuan.id
					resItem=createRes(wangYuan)
					res.push(resItem)
				}
				else{
					let fenPeiRes=fenPei(wangYuan,num)
					num++
					res.push(...fenPeiRes)
				}
			}
			console.log(wangYuans);
			return res
		}
		function calculateVoPcf(wangYuan){
			let poolNeed=0,cities=uploadFile[sheetName.city]
			for(let city of cities){
				if(wangYuan.cities5gStr.includes(city.cityNameStr)){
					if(wangYuan.cities4gStr.includes(city.cityNameStr)){
						poolNeed+=city.userImsStr/(liYongLv_dom.value/100)
					}else{
						poolNeed+=city.user5gStr/(liYongLv_dom.value/100)
					}
				}
				else if(wangYuan.cities4gStr.includes(city.cityNameStr)){
					poolNeed+=city.user4gStr/(liYongLv_dom.value/100)
				}
			}
			return poolNeed
		}
		function calculateControll(){
			let wangYuans=uploadFile[sheetName.wangYuan]
			let resItem,res=[]
			let wangYuanGroupByCity={},numNeed,poolNeed=poolNeed4g=poolNeed5g=poolNeed2g=0
			// 根据5G地市对网元进行分组，即为分POOL
			for(let wangYuan of wangYuans){
				if(wangYuan.cities5gStr in wangYuanGroupByCity){
					wangYuanGroupByCity[wangYuan.cities5gStr].push(wangYuan)
				}else{
					wangYuanGroupByCity[wangYuan.cities5gStr]=[wangYuan]
				}
			}
			for(let pool of Object.values(wangYuanGroupByCity)){
				// 新建网元ID起始
				let newNum=pool.length+1
				// pool所需规模
				poolNeed=poolNeed5g=0
				if(wangYuanName=='voPCF'){
					poolNeed=calculateVoPcf(pool[0])
				}else{
					// pool所需软件规模计算公式
					poolNeed2g=pool[0].user2gStr*getUserToPdu()/(liYongLv_dom.value/100)*(jiHuoBI_dom.value/100)
					poolNeed4g=(pool[0].user4gStr+(1-zhuLiuBi_dom.value/100)*pool[0].user5gStr)*getUserToPdu()/(liYongLv_dom.value/100)
					poolNeed5g=pool[0].user5gStr*getUserToPdu()/(liYongLv_dom.value/100)*(zhuLiuBi_dom.value/100)
					poolNeed=poolNeed2g+poolNeed4g+poolNeed5g
				}
				// 新建套数需求
				numNeed=Math.ceil(poolNeed/(menXian[wangYuanName].value/getRuanToYing()))
				// 将新建套数转为偶数
				numNeed=numNeed%2==0?numNeed:numNeed+1
				// AMF、SMF至少要4套
				if(numNeed<5&&(wangYuanName=='AMF'||wangYuanName=='SMF'))
					numNeed=4
				// 需求套数小于当前pool内网元套数时，需求套数至少为pool内网元套数
				numNeed=numNeed>pool.length?numNeed:pool.length
				// 单套软件规模计算
				overRuanJian=Math.ceil(poolNeed/numNeed)
				overRuanJian4g=Math.ceil(poolNeed4g/numNeed)
				overRuanJian5g=Math.ceil(poolNeed5g/numNeed)
				// 软件规模转硬件规模
				overYingJian=overRuanJian*getRuanToYing()
				overYingJian4g=overRuanJian4g*getRuanToYing()
				overYingJian5g=overRuanJian5g*getRuanToYing()
				// 统一pool内网元厂家名称
				shop=pool[0].shop
				// 扩容网元收录
				for(let wangYuan of pool){
					// 获取网元现状
					getNow(wangYuan)
					// 当前pool内已有网元名称不变
					pool[0].name=province+wangYuanName+translate[shop]+wangYuan.id
					// 创建符合表格格式的网元对象
					resItem=createRes(pool[0])
					// 收录扩容网元
					res.push(resItem)
				}
				// 新建网元收录
				for(let newId=newNum;newId<newNum+numNeed-pool.length;newId++){
					getNow(0)
					pool[0].name=province+wangYuanName+translate[shop]+newId
					resItem=createRes(pool[0])
					res.push(resItem)
				}
			}
			console.log(res);
			return res
		}
		function calculateUpf(){
			
		}
		function calculateByExcel(){
			getWangYuanUsers(uploadFile[sheetName.wangYuan])
			let res
			if(controllWangYuanTypes.includes(wangYuanName)){
				res=calculateControll()
			}
			if(dataWangYuanTypes.includes(wangYuanName)){
				res=calculateData()
			}
			return res
		}
		// 004
		
		go.onclick=()=>{
			let totalRow
			if(layTable=='itemRes'){
				showData[layTable]=calculateByExcel()
				totalRow={
					nowRuanJian:0,nowRuanJian5g:0,nowRuanJianIms:0,nowYingJian:0,nowYingJian5g:0,nowYingJianIms:0,
					addRuanJian:0,addRuanJian5g:0,addRuanJianIms:0,addYingJian:0,addYingJian5g:0,addYingJianIms:0,
					overRuanJian:0,overRuanJian5g:0,overRuanJianIms:0,overYingJian:0,overYingJian5g:0,overYingJianIms:0,
				}
			}else{
				showData[layTable]=calculateWuLi()
				totalRow={
					core:0,storage:0,memory:0
				}
			}
			// console.log(showData);
			for(let wangYuan of showData[layTable]){
				for(let type in totalRow){
					totalRow[type]+=wangYuan[type]
				}
			}
			totalRow.name='总计'
			table.reload(layTable,{
				elem:'#'+layTable,
				data:showData[layTable],
				totalRow,
				page:true
			})
		}
		exports_dom.onclick=()=>{
			exports(showData)
		}
		
	</script>
	<style type="text/css">
		#all{
			padding: 25px 10px;
			display: flex;
		}
		form{
			min-width: 462px;
			max-width: 470px;
		}
		.layui-input{
			max-width: 80px;
			display: inline-block;
		}
		.layui-table-view .layui-table{
			width: 100%;
		}
		form table .layui-input{
			max-width: 110px;
		}
		form table{
			width: 100%;
		}
		form td{
			padding-bottom: 10px;
			text-align: center;
		}
		form td:nth-of-type(n+9){
			padding-bottom: 0px;
		}
		form td:nth-of-type(3n){
			padding-left: 25px;
		}
		input[type="file"] {
			color: transparent;
		}
		.item{
			display: flex;
			margin: 10px 0;
		}
		.middle{
			display: flex;
			flex-wrap: wrap;
		}
		.middle .item:nth-of-type(odd){
			width: 57%;
		}
		#form .middle .serverType{
			width: 65%;
		}
		.layui-form-select input{
			max-width: 1000px;
		}
		.layui-table-page .layui-laypage{
			text-align: center;
			display: block;
		}
		label{
			line-height: 38px;
		}
		label:nth-of-type(even){
			margin-left: 10px;
		}
		.wuLiRes,.U,.imsWangYuan{
			display: none;
		}
		#go{
			width: 100%;
		}
		.upload{
			
		}
		#upload{
			display: none;
		}
		#exports{
			width: 200px;
			display: block;
			margin: 0 auto;
		}
	</style>
</html>
